package org.dromara.system.domain.vo;


import java.math.BigDecimal;
import java.math.RoundingMode;

public class SensorVo {

    private String ts;
    private Long deviceId;

    private BigDecimal value;
    public Long getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(Long deviceId) {
        this.deviceId = deviceId;
    }

    public String getTs() {
        return ts;
    }

    public void setTs(String ts) {
        this.ts = ts;
    }


    public void setValue(BigDecimal sensorValue) {
        if (sensorValue != null) {
            this.value = sensorValue.setScale(3, RoundingMode.HALF_UP);
        } else {
            this.value = new BigDecimal("0.000");
        }
    }

    public BigDecimal getValue() {
        return value;
    }
}
